<template>
  <div class="city">
    <cityHeader/>
    <List :hotCities='hotCities' :cities='cities'></List>
  </div>
</template>

<script>
import cityHeader from './components/cityHeader'
import List from './components/List'
import axios from 'axios'
export default {
  name:'City',
  mounted () {
    this._initData()
  },
  data () {
    return {
      hotCities: [],
      cities: {}
    }
  },
  methods: {
    _initData () {
      axios.get('./static/mock/city.json')
        .then((res) => {
          let data = res.data
          console.log(data.ret,data.data)
          if(data.ret && data.data) {
            this.hotCities = data.data.hotCities
            this.cities = data.data.cities
          }
        })
    }
  },
  components: {
    cityHeader,
    List
  }
}
</script>

<style scoped lang='stylus'>
.city
  width 100%
  height 100%
  display flex
  flex-direction column
</style>